<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s" %>

<html>
  <head>
    <title>添加新闻</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
  </head>
  
  <body>	
  	 
  	 <!-- 判断：如果用户登录： 显示欢迎你，退出 -->
     <!-- 判断：如果用户没有登录： 显示登录、注册 -->
     <div align="center" style="width:80% ">
        <s:if test="#session.userInfo != null">
	                    欢迎你： <s:property value="#session.userInfo.uname"/><%-- &nbsp;
	         <s:a href="#">退出</s:a>
	         --%>
	         <s:a href="news_viewAdd">添加新闻</s:a>
       </s:if>
       <s:else>
           <s:a href="login.jsp">登录</s:a>
	      <s:a href="register.jsp">注册</s:a>
      </s:else>
    </div> 
  
  
  	<s:form action="news_save" method="post" theme="simple">
  	 <table border="1" align="center" cellpadding="5" cellspacing="0">
  	 	<tr>
  	 		<td>新闻标题</td>
  	 		<td>
  	 			<s:textfield name="ntitle" id="ntitle" value=""></s:textfield>
  	 		</td>
  	 	</tr>
  	 	
  	 	<tr>
  	 		<td>新闻内容</td>
  	 		<td>
  	 			<s:textfield name="ncontent" id="ncontent"></s:textfield>
  	 		</td>
  	 	</tr>
  	 	
  	 	<tr>
  	 		<td colspan="2">
  	 			<s:submit value="添加新闻"></s:submit>
  	 		</td>
  	 	</tr>
  	 </table>
  	 
  	 <div align="center">
  	    <h1 align="center">
  	       <a href="news_list.action">返回</a>
  	    </h1>
  	 </div>
  	 
  	 
  	 </s:form>
  </body>
</html>